package com.edu.design.proxy.statics;

/**
 * 代理对象，代理购票服务，额外职责购买保险
 * @author Administrator
 *
 */
public class TicketProxy implements TicketService{
	
	TicketService ticketService;
	
	public TicketProxy(TicketService pTicketService) {
		super();
		ticketService = pTicketService;
	}

	@Override
	public void buyTicket(String pUserName) {
		buySafe(pUserName);
		ticketService.buyTicket(pUserName);
	}
	
	private void buySafe(String pUserName){
		System.out.println(pUserName+"购买保险");
	}

}
